package com.kaoshi.management.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kaoshi.management.pojo.RolePermissionVo;
import org.apache.ibatis.annotations.Select;

public interface RolePermissionVoMapper extends BaseMapper<RolePermissionVo> {


    @Select("SELECT p.id permissionId, r.role_name roleName, p.permission_name permissionName,e.name\n" +
            "            FROM xt_roles r\n" +
            "            JOIN enter e ON r.eid=e.role\n" +
            "            JOIN xt_role_permissions rp ON r.id = rp.role_id\n" +
            "            JOIN xt_permissions p ON rp.permission_id = p.id where r.id =#{roleId}")
    Page<RolePermissionVo> getPageList(Page<RolePermissionVo> page, LambdaQueryWrapper<RolePermissionVo> queryWrapper, Integer roleId);
}
